<?php

namespace app\common\validate;

use think\Validate;

class EvalutationValidate extends BaseValidate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'name|姓名'=> 'require|length:1,10',
        'sex|性别'=> 'require|in:1,2',
        'birthday|生日'=> 'require|dateFormat:Y-m-d',
        'height|身高'=> 'require|between:10,400',
        'weight|体重'=> 'require|between:2,400',
        'mobile|电话'=> 'require|isMobile',
        'role|角色'=> 'require|in:1,2,3,4,5,6',
    ];
    /**
     * 提示消息
     */
    protected $message = [
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['name', 'sex', 'birthday', 'height', 'weight', 'mobile'],
        'adduser'  => ['name', 'sex', 'birthday', 'role', 'mobile'],
        'edit' => [],
    ];

}
